package com.service.impl;

import com.bean.pojo.AirQualityIndex;
import com.bean.vo.AirQualityIndexVo;
import com.dao.AirQualityIndexMapper;
import com.service.AirQualityIndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
public class AirQualityIndexServiceImpl implements AirQualityIndexService {

    @Autowired
    private AirQualityIndexMapper am;

    @Transactional
    @Override
    public int save(AirQualityIndex airQualityIndex) {
        return am.insert(airQualityIndex);
    }

    @Transactional
    @Override
    public int remove(AirQualityIndex airQualityIndex) {
        return am.delete(airQualityIndex);
    }

    @Transactional
    @Override
    public int modify(AirQualityIndex airQualityIndex) {
        return am.update(airQualityIndex);
    }

    @Override
    public List<AirQualityIndexVo> query(AirQualityIndex airQualityIndex) {
        return am.select(airQualityIndex);
    }

    @Override
    public int queryCount(Map<String, Object> map) {
        return am.selectCount(map);
    }

    @Override
    public List<AirQualityIndexVo> queryByPage(Map<String, Object> map) {
        return am.selectByPage(map);
    }
}
